<?php
class Preview_model extends Mymodel {
	public $table_name = "list_preview";
	public $table_name2 = "preview_template";
    function Preview_model()
    {
        parent::Mymodel();
    }
	
	//List Privew
	function get_list_preview($id=NULL)
	{
		return $this->get_data($this->table_name, $id);
	}
	
	function insert_preview($data)
	{
		return $this->insert_new_record($this->table_name , $data);
	}


	function update_list_preview_by_id($data, $id)
	{
		return $this->update_by_id($this->table_name, $data, $id);
	}

        //Templates in the privew
        function get_template($id=NULL)
        {
            return $this->get_data($this->table_name2, $id);
        }

	function insert_template($data)
	{
		return $this->insert_new_record($this->table_name2 , $data);
	}

	function update_template_by_id($data, $id)
	{
		return $result = $this->update_by_id($this->table_name2, $data, $id);
                //$this->show_the_query();
                
	}
}
